package com.ruoyi.system.service.construction.impl;

import com.ruoyi.system.domain.construction.QualifiPicInfo;
import com.ruoyi.system.mapper.construction.QualifiPicInfoMapper;
import com.ruoyi.system.service.construction.QualifiPicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class QualifiPicInfoServiceImpl implements QualifiPicInfoService {


    @Autowired
    private QualifiPicInfoMapper qualifiPicInfoMapper;



    /**
     * 查询施工队图片信息
     *
     * @param qualifiPicId 施工队图片信息ID
     * @return 施工队图片信息
     */
    @Override
    public QualifiPicInfo selectQualifiPicInfoById(Integer qualifiPicId)
    {
        return qualifiPicInfoMapper.selectQualifiPicInfoById(qualifiPicId);
    }

    @Override
    public QualifiPicInfo findAllRongIdTwo(Integer supplierId) {
        return qualifiPicInfoMapper.findAllRongIdTwo(supplierId);
    }

    @Override
    public List<QualifiPicInfo> findAllRongId(Integer supplierId) {
//        Integer constructionIdsnum = qualifiPicInfo.getConstructionIdsnum();
//        System.err.println("************constructionIdsnum***********"+constructionIdsnum);
//        qualifiPicInfo.setConstructionId(constructionIdsnum);
        return qualifiPicInfoMapper.findAllRongId(supplierId);
    }

    @Override
    public List<QualifiPicInfo> findAllRongIdTwoen(Integer supplierId) {
        return qualifiPicInfoMapper.findAllRongIdTwoen(supplierId);
    }

    @Override
    public List<QualifiPicInfo> findAllRongIdThree(Integer supplierId) {
        return qualifiPicInfoMapper.findAllRongIdThree(supplierId);
    }

    /**
     * 查询施工队图片信息列表
     *
     * @param qualifiPicInfo 施工队图片信息
     * @return 施工队图片信息
     */
    @Override
    public List<QualifiPicInfo> selectQualifiPicInfoList(QualifiPicInfo qualifiPicInfo)
    {
        Integer supplierIdnum = qualifiPicInfo.getSupplierIdnum();

        qualifiPicInfo.setConstructionId(supplierIdnum);
        return qualifiPicInfoMapper.selectQualifiPicInfoList(qualifiPicInfo);
    }

    /**
     * 新增施工队图片信息
     *
     * @param qualifiPicInfo 施工队图片信息
     * @return 结果
     */
    @Override
    public int insertQualifiPicInfo(QualifiPicInfo qualifiPicInfo)
    {
//        Integer numsupplierId = qualifiPicInfo.getNumsupplierId();
//        qualifiPicInfo.setConstructionId(numsupplierId);
//        qualifiPicInfo.setModifiedTime(new Date());
        return qualifiPicInfoMapper.insertQualifiPicInfo(qualifiPicInfo);
    }

    /**
     * 修改施工队图片信息
     *
     * @param qualifiPicInfo 施工队图片信息
     * @return 结果
     */
    @Override
    public int updateQualifiPicInfo(QualifiPicInfo qualifiPicInfo)
    {
        return qualifiPicInfoMapper.updateQualifiPicInfo(qualifiPicInfo);
    }

    /**
     * 批量删除施工队图片信息
     *
     * @param qualifiPicIds 需要删除的施工队图片信息ID
     * @return 结果
     */
    @Override
    public int deleteQualifiPicInfoByIds(Integer[] qualifiPicIds)
    {
        return qualifiPicInfoMapper.deleteQualifiPicInfoByIds(qualifiPicIds);
    }

    /**
     * 删除施工队图片信息信息
     *
     * @param qualifiPicId 施工队图片信息ID
     * @return 结果
     */
    @Override
    public int deleteQualifiPicInfoById(Integer qualifiPicId)
    {
        return qualifiPicInfoMapper.deleteQualifiPicInfoById(qualifiPicId);
    }
}
